<!--{template "topic_header"}-->
<script type="text/javascript" src="js/validate.js"></script>
<script>
/**
 * 发送私信时 选择关注好友
 */
function PmFollowUserDialog(page)
{
	var handle_key = 'del_pm_follow_user';
	
	$("#_user_list").remove();
	
	showDialog('del_pm_follow_user', 'ajax', '选择已关注的好友', {"url":"ajax.php?mod=pm&code=pm_follow_user&page="+page}, 500);	
	//用户勾选状态
		
}


function pm_group_list(page,group_id)
{
	//var group_id = $('#group_id').val();

	var uid = '{MEMBER_ID}';
	var page = 'undefined' == typeof(page) ? '0' : page;
	

	
	//alert(group_id);
	if(uid == '')
	{
		ShowLoginDialog();
	}
	

	var myAjax = $.post
    (
		"ajax.php?mod=pm&code=pm_group_list&page="+page,
		{	
			uid:uid,
			group_id:group_id,
			page:page
		},
		function (d) 
        {
            if(d) 
            {	
               $('#'+"pm_group_user_list").html(d);
            }
				
				  //用户勾选状态
				  var tag_name = $('#txtMsgTo').val();
			
				  var stringArray = tag_name.split(",");
			
				  for(i=0;i<10;i++)   
				  {   
				  		if(stringArray[i] != 'undefined')
						{	
							//打勾
							$("#checked_"+stringArray[i]).attr("checked",true);
						}
				  }  
			
            //location.reload();         
		}
	);
	
	return true;
	
}
</script>
<div class="main {$t_col_main}">

<!--此处三栏-->
<div class="t_col_main_si {$t_col_main_side}">
<div class="t_col_main_fl">
	<div id="topic_index_left_ajax_list">
	<!--{if MEMBER_STYLE_THREE_TOL == 1}-->
	 {template "topic_left.inc"}
	<!--{/if}-->
	</div>
</div>
</div>
<!--此处三栏-->
  <div class="mainL">
    <div class="mblogTitle">当前：<a href="index.php?mod=pm&code=send&folder=send">发送新信息</a></div>
	
	<!--以下站内短信导航部分-->
    {$left_menu}
	
	<!--以上站内短信导航部分-->
	<!--分组用户显示-->
	<div id="pm_group_user_list"></div>
	<!--分组用户显示-->
    <div class="sendBox">
      <form action="{$action}" method="post" onsubmit="return Validator.Validate(this,3);" id='sendPM'>
        <table width="100%" border="0" style="font-size:12px;">
          <tr>
            <td width="16%" align="right" valign="middle">收件人：</td>
            <td width="68%" align="left" valign="middle">
			 <input type="text" id="txtMsgTo" name="to_user" value="{$to_user}" class="text-area" datatype="LimitB" min="1" msg="收件人不能为空" /></a>		    </td>
            <td width="16%" rowspan="5" align="left" valign="top">
			<!--{if $my_grouplist}-->
			<div style=" margin:0 0 0 20px;">
				<!--{loop $my_grouplist $val}-->		
				<li style="float:left; width:80px;">
				<a href="javascript:viod(0);" onclick="pm_group_list('0','{$val[id]}');">{$val[group_name]} ({$val[group_count]})</a>
				</li>
				<!--{/loop}-->
				<li class="B_linedot" style="float:left; width:80px;"></li>
                <!--<li><a href="javascript:void(0);" onclick="PmFollowUserDialog();return false;">选择好友</a></li>-->				
                <li><a href="javascript:void(0)" onclick="showFollowGroupAddDialog();">添加分组</a></li>
				<li><a href="index.php?mod={$member[username]}&code=follow">管理分组</a></li>

			</div>	
			<!--{/if}-->			
			</td>
          </tr>
          <!--{if $buddy_list}-->
          <tr>
            <td align="right" valign="middle">好友群发：</td>
            <td align="left" valign="middle">
			<!--{loop $buddy_list $buddy}-->
              <input type="checkbox" style="border:0" name="buddy_list[{$buddy[buddyid]}]" value="{$buddy['nickname']}">
              <span title="{$buddy[description]}">{$buddy[nickname]}</span> &nbsp;
              <!--{/loop}-->            </td>
          </tr>
          <!--{/if}-->
          <tr>
            <td align="right" valign="top"><span valign="top">内容：</span></td>
            <td align="left" valign="middle"><textarea cols="45" rows="8" name="message" datatype="LimitB" min="1" msg="内容不能为空"  class="text-area">{$message}</textarea>            </td>
          </tr>
          <tr>
            <td align="right" valign="middle">&nbsp;</td>
            <td align="left" valign="middle"><input name="save_to_outbox" type="checkbox" id="outbox" value="1" style="border:0">
              不发送，只保存到草稿箱中</td>
          </tr>
          <tr>
            <td align="right" valign="middle">&nbsp;</td>
            <td align="left" valign="middle"><button type="submit" id="#submit" class="save">发送</button></td>
          </tr>
        </table>
      </form>
    </div>
	
	
	
	
	
	
    <!--{if $pm}-->
    <div style="border:1px solid #ccc;padding:5px;margin:5px;color:#484848;"><b>{$to_user}说:</b><br>
      {$pm[message]}</div>
    <!--{/if}-->
	
  </div>
  <!--左边结束，右边开始-->
  <!--{template "topic_right.inc"}-->
</div>
<!--{template "topic_footer"}-->
